class DynamicDataModel {
  String headImage;
  String userName;
  String time;
  String content;
  List<String> images;
  int likeCount;
  int commentCount;
  int focus;
  bool isLike; // 是否已点赞
  bool isFocus; // // 是否已关注

  DynamicDataModel.fromJsonMap(Map<String, dynamic> map)
      : headImage = map["headImage"],
        userName = map["userName"],
        time = map["time"],
        content = map["content"],
        images = List<String>.from(map["images"]),
        likeCount = map["likeCount"]??0,
        commentCount = map["commentCount"]??0,
        isLike = map["isLike"]??false,
        isFocus = map["isFocus"]??false,
        focus = map["focus"]??0;

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['headImage'] = headImage;
    data['userName'] = userName;
    data['time'] = time;
    data['content'] = content;
    data['images'] = images;
    data['likeCount'] = likeCount;
    data['commentCount'] = commentCount;
    data['focus'] = focus;
    data['isLike'] = isLike;
    data['isFocus'] = isFocus;
    return data;
  }
}